package com.zit.java.dao;

import com.github.pagehelper.Page;
import com.zit.java.pojo.SysRoleUser;
import com.zit.java.pojo.SysUser;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface SysUserMapper {

    int deleteByPrimaryKey(Integer id);

    int insert(SysUser record);

    int insertSelective(SysUser record);

    SysUser selectByPrimaryKey(Integer id);


    int updateByPrimaryKeySelective(SysUser record);

    int updateByPrimaryKey(SysUser record);


    /**
     * 根据条件查询用户信息
     *
     * @param name
     * @param loginName
     * @return
     */
    Page<SysUser> queryUserByCondition(@Param("name") String name, @Param("loginName") String loginName);

    /**
     * 根据用户id查询角色信息
     *
     * @param id
     * @return
     */
    List<Map<String, Object>> queryAllRolesByUser(@Param("id") String id);

    int deleteByuserId(@Param("id") String id);

    /**
     * 添加 角色与用户对应记录
     *
     * @param roleUser
     * @return
     */
    int insertSr(SysRoleUser roleUser);

    int insertSrSelective(SysRoleUser roleUser);

    SysUser selectByUserName(@Param("name") String name);
}
